<template>
	<div class="front employeeView bj">
        <el-scrollbar style="height: 100%;">
            <el-form label-width="90px" label-position="left" :model="formData" style="margin-top: 15px !important;">
                <el-form-item label="用户名：" prop="userName">
                    <el-input v-model.trim="formData.userName" readonly></el-input>
                </el-form-item>
                <el-form-item label="名称：" prop="name">
                    <el-input v-model.trim="formData.name" readonly></el-input>
                </el-form-item>
                <el-form-item label="助记码：" prop="mnemonicCode">
                    <el-input v-model.trim="formData.mnemonicCode" readonly></el-input>
                </el-form-item>
                <el-form-item label="性别：" prop="sex">
                    <el-input v-model.trim="formData.sex" readonly></el-input>
                </el-form-item>
                <el-form-item label="身份证：" prop="idNumber">
                    <el-input v-model.trim="formData.idNumber" readonly></el-input>                    
                </el-form-item>
                <el-form-item label="出生日期：" prop="birthday">
                    <el-input v-model.trim="formData.birthday" readonly></el-input>
                </el-form-item>
                <el-form-item label="手机：" prop="phone">
                    <el-input v-model.trim="formData.phone" readonly></el-input>
                </el-form-item>
                <el-form-item label="座机：" prop="telephone">
                    <el-input v-model.trim="formData.telephone" readonly></el-input>
                </el-form-item>
                <el-form-item label="微信：" prop="wechatNumber">
                    <el-input v-model.trim="formData.wechatNumber" readonly></el-input>
                </el-form-item>
                <el-form-item label="QQ：" prop="qqNumber">
                    <el-input v-model.trim="formData.qqNumber" readonly></el-input>
                </el-form-item>
                <el-form-item label="微博：" prop="microblogNumber">
                    <el-input v-model.trim="formData.microblogNumber" readonly></el-input>
                </el-form-item>
                <el-form-item label="文化程度：" prop="education">
                    <el-input v-model.trim="formData.educationAux" readonly></el-input>
                </el-form-item>
                <el-form-item label="部门：" prop="department">
                    <el-input v-model.trim="formData.deptName" readonly></el-input>
                </el-form-item>
                <el-form-item label="职务：" prop="position">
                    <el-input v-model.trim="formData.typeAux" readonly></el-input>
                </el-form-item>
                <el-form-item label="开户银行：" prop="bank">
                    <el-input v-model.trim="formData.bank" readonly></el-input>
                </el-form-item>
                <el-form-item label="开户网点：" prop="bankBranches">
                    <el-input v-model.trim="formData.bankBranches" readonly></el-input>
                </el-form-item>
                <el-form-item label="银行账号：" prop="bankAccount">
                    <el-input v-model.trim="formData.bankAccount" readonly></el-input>
                </el-form-item>
                <el-form-item label="入职时间：" prop="hiredate">
                    <el-input v-model.trim="formData.hiredate" readonly></el-input>
                </el-form-item>
                <el-form-item label="离职时间：" prop="termdate">
                    <el-input v-model.trim="formData.termdate" readonly></el-input>
                </el-form-item>
                <el-form-item label="地址：" prop="address">
                    <el-input v-model.trim="formData.address" readonly></el-input>
                </el-form-item>
                <el-form-item label="职员类别：" prop="type">
                    <el-input v-model.trim="formData.typeAux" readonly></el-input>
                </el-form-item>
                <el-form-item label="备注：" prop="remark">
                    <el-input v-model.trim="formData.remark" readonly></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="danger" size="small" @click="close">关闭</el-button>
                </el-form-item>
            </el-form>
        </el-scrollbar>
	</div>
</template>
<script>
export default {
	data() {
		return {
			formData: {},
			educationList: [],			//文化程度
			positionList: [],			//职务列表
			employeeTypeList: [],		//职员类型列表
			lastDepart: ''
		}
	},
	computed: {
		rowId() {
			return this.$store.state.empStore.rowId;
		}
	},
	methods: {
		getData() {
			this.$http.get('employee/findSingleEmployee?id=' + this.rowId).then(res => {
				if(res.data.code == 20001) {
					if(res.data.data) {
						res.data.data['department'] = res.data.data['department'].toString();
						res.data.data['position'] = res.data.data['position'].toString();
						this.lastDepart = res.data.data['deptName'];
						this.formData = res.data.data;
						this.formData['sex'] = this.formData['sex'] == 1 ? '男' : '女';
					}
				}
			});
		},
		close() {
			let index = parent.layer.getFrameIndex(window.name);    //先得到当前iframe层的索引
            parent.layer.close(index);
		}
	},
	created() {
		this.getData();
	}
}
</script>
<style>
	.employeeView .el-input--prefix .el-input__inner {padding-left: 30px !important;}
</style>